import { Body, Controller, Inject, Post } from '@nestjs/common';
import { UserService } from './user.service';
import { UserAddDto } from './user.dto';
import { ApiOperation, ApiTags } from '@nestjs/swagger';

@ApiTags('用户')
@Controller('user')
export class UserController {
  @Inject(UserService)
  private readonly userService: UserService;

  @ApiOperation({ summary: '创建或保存用户' })
  @Post('update')
  createOrSave(@Body() body: UserAddDto) {
    return this.userService.createOrSave(body);
  }
}
